package com.magnificent.atlantis.common.entity.messages;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.MappedSuperclass;
import javax.persistence.Table;
import java.util.ArrayList;

/**
 * User: Babanin
 * Date: 04.05.2009
 * Time: 22:47:28
 */
@Entity()
@MappedSuperclass
@Table(name = "message_invite_meeting")
public class ServerInviteMessage extends ServerMeetingMessage {
    private ArrayList<Integer> invited;

    public ServerInviteMessage() {
    }

    @Lob()
    public ArrayList<Integer> getInvited() {
        return invited;
    }

    public void setInvited(ArrayList<Integer> invited) {
        this.invited = invited;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;

        ServerInviteMessage that = (ServerInviteMessage) o;

        if (invited != null ? !invited.equals(that.invited) : that.invited != null) return false;

        return true;
    }

    public int hashCode() {
        int result = super.hashCode();
        result = 31 * result + (invited != null ? invited.hashCode() : 0);
        return result;
    }
}
